.\" ****************************************************************************
.\"  record_configure_output.3                                 recorder library
.\" ****************************************************************************
.\"
.\"   File Description:
.\"
.\"     Man page for the recorder library
.\"
.\"     This documents
.\"       record_configure_output(3)
.\"       record_configure_show(3)
.\"       record_configure_format(3)
.\"
.\"
.\" ****************************************************************************
.\"  (C) 2019-2020 Christophe de Dinechin <christophe@dinechin.org>
.\" %%%LICENSE_START(LGPLv3+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU Lesser General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU Lesser General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU Lesser General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\" ****************************************************************************

.TH record 3  "2019-03-09" "1.0" "Recorder Library"

.\" ----------------------------------------------------------------------------
.SH NAME
.\" ----------------------------------------------------------------------------

record_configure_output \- Configure recorder  output
record_configure_show \- Configure recorder output function
record_configure_format \- Configure recorder event formatting


.\" ----------------------------------------------------------------------------
.SH SYNOPSIS
.\" ----------------------------------------------------------------------------
.nf
.B #include <recorder/recorder.h>
.PP
.BI "typedef unsigned (*recorder_show_fn) (const char *" text ","
.BI "                                      size_t" len ","
.BI "                                      void *" output ");"
.BI "typedef void (*recorder_format_fn)(recorder_show_fn " show ","
.BI "                                   void *" output ","
.BI "                                   const char * "label ","
.BI "                                   const char *" location ","
.BI "                                   uintptr_t" order ","
.BI "                                   uintptr_t" timestamp ","
.BI "                                   const char *" message ");"
.PP
.BI "void *recorder_configure_output(void *" output ");"
.BI "recorder_show_fn   recorder_configure_show(recorder_show_fn" show ");"
.BI "recorder_format_fn recorder_configure_format(recorder_format_fn" format ");"

.fi
.PP


.\" ----------------------------------------------------------------------------
.SH DESCRIPTION
.\" ----------------------------------------------------------------------------
.PP
The
.BR recorder_configure_output()
function configures the output for the recorder output function. The default
output function assumes that
.I output
is a
.B FILE *
and uses
.B stderr
if NULL. Since recorder tracing is often used for debugging, it may be
a good idea to make the output non-buffered using
.B "setvbuf(output,NULL,_IONBF,0);"

.PP
The
.BR recorder_configure_show()
function configures the output funtion for the recorder. This output
function receives the
.I output
value defined by
.BR recorder_configure_output.

.PP
The
.BR recorder_configure_format()
function configures the event record formatting function.


.\" ----------------------------------------------------------------------------
.SH RETURN VALUE
.\" ----------------------------------------------------------------------------
.PP
The functions return the previously configured value.




.\" ----------------------------------------------------------------------------
.SH BUGS
.\" ----------------------------------------------------------------------------

.PP
Bugs should be reported using https://github.com/c3d/recorder/issues.


.\" ----------------------------------------------------------------------------
.SH SEE ALSO
.\" ----------------------------------------------------------------------------
.BR record (3),
.BR record_fast (3),
.br
.BR RECORDER_DEFINE (3),
.BR RECORDER_DECLARE (3)
.br
.BR recorder_trace_set (3)
.BR RECORDER_TRACE (3)
.br
.BR recorder_dump (3),
.BR recorder_dump_for (3),

.PP
Additional documentation and tutorials can be found
at https://github.com/c3d/recorder.


.\" ----------------------------------------------------------------------------
.SH AUTHOR
.\" ----------------------------------------------------------------------------
Written by Christophe de Dinechin
